<!--{eval $_G['home_tpl_nosidebar']=1;}-->
<!--{template common/header}-->

<form id="loginform" name="loginform" action="home.php?mod=misc&ac=$_G['setting'][login_action]&$url_plus&ref" method="post" autocomplete="off" class="c_form">
<table cellpadding="0" cellspacing="0" class="formtable">
	<caption>
		<h2>{lang login_plese}</h2>
		<p>{lang have_account_message}</p>
	</caption>
	<!--{if $invitearr}-->
	<tr>
		<th width="100">{lang invite_friends}</th>
		<td>
			<a href="home.php?mod=space&$url_plus" target="_blank"><!--{avatar($invitearr[uid],small)}--></a>
			<a href="home.php?mod=space&$url_plus" target="_blank">{$invitearr[username]}</a>
		</td>
	</tr>
	<!--{/if}-->
	
	<!--{if $_G['setting']['seccode_login']}-->
	<!--{if $_G['input_seccode']}-->
	<tr>
		<th width="100">&nbsp;</th>
		<td>
		{lang input_seccode_message}
		</td>
	</tr>
	<!--{/if}-->
	<!--{if $_G['setting']['questionmode']}-->
	<tr>
		<th width="100" style="vertical-align: top;">{lang answer_question_first}</th>
		<td>
			<p><!--{eval question();}--></p>
			<input type="text" id="seccode" name="seccode" value="" tabindex="1" class="t_input"<!--{if empty($_G['input_seccode'])}--> onBlur="checkSeccode()"<!--{/if}--> />&nbsp;<span id="checkseccode">&nbsp;</span>
		</td>
	</tr>
	<!--{else}-->
	<tr>
		<th width="100" style="vertical-align: top;">{lang seccode}</th>
		<td>
			<script>seccode();</script>
			<p>{lang enter_char_message}<a href="javascript:updateseccode()">{lang replacement_of_a}</a></p>
			<input type="text" id="seccode" name="seccode" value="" tabindex="1" class="t_input"<!--{if empty($_G['input_seccode'])}--> onBlur="checkSeccode()"<!--{/if}--> />&nbsp;<span id="checkseccode">&nbsp;</span>
		</td>
	</tr>
	<!--{/if}-->
	<!--{/if}-->
	
	<tbody style="display:<!--{if $_G['input_seccode']}-->none<!--{/if}-->;">
	<tr><th width="100"><label for="username">{lang username}</label></th><td><input type="text" name="username" id="username" class="t_input" value="$membername" tabindex="2" /></td></tr>
	<tr><th width="100"><label for="password">{lang password}</label></th><td><input type="password" name="password" id="password" class="t_input" tabindex="3" value="$password" /></td></tr>
	<tr>
		<th width="100">&nbsp;</th>
		<td>
			<input type="checkbox" id="cookietime" name="cookietime" value="315360000" $cookiecheck style="margin-bottom: -2px;"><label for="cookietime">{lang auto_login_next}</label>
		</td>
	</tr>
	</tbody>
	<tr><th width="100">&nbsp;</th><td>
		<input type="hidden" name="refer" value="$refer" />
		<input type="submit" id="loginsubmit" name="loginsubmit" value="{lang login}" class="submit" tabindex="5" />
		<a href="home.php?mod=misc&ac=lostpasswd">{lang lost_password}</a>
	</td></tr>
</table>
<input type="hidden" name="formhash" value="{FORMHASH}" /></form>

<script type="text/javascript">
	var lastSecCode = '';
	function checkSeccode() {
		var seccodeVerify = $('seccode').value;
		if(seccodeVerify == lastSecCode) {
			return;
		} else {
			lastSecCode = seccodeVerify;
		}
		ajaxresponse('checkseccode', 'op=checkseccode&seccode=' + (is_ie && document.charset == 'utf-8' ? encodeURIComponent(seccodeVerify) : seccodeVerify));
	}
	function ajaxresponse(objname, data) {
		var x = new Ajax('XML', objname);
		x.get('home.php?mod=misc&ac=$_G['setting'][register_action]&' + data, function(s){
			var obj = $(objname);
			s = trim(s);
			if(s.indexOf('succeed') > -1) {
				obj.style.display = '';
				obj.innerHTML = '<img src="{STATICURL}image/home/check_right.gif" width="13" height="13">';
				obj.className = "warning";
			} else {
				warning(obj, s);
			}
		});
	}
	function warning(obj, msg) {
		if((ton = obj.id.substr(5, obj.id.length)) != 'password2') {
			$(ton).select();
		}
		obj.style.display = '';
		obj.innerHTML = '<img src="{IMGDIR}/check_error.gif" width="13" height="13"> &nbsp; ' + msg;
		obj.className = "warning";
	}

</script>

<!--{if $_G['input_seccode']}-->
<script>
$('seccode').style.background = '#FFFFCC';
$('seccode').focus();
</script>
<!--{/if}-->


<div class="c_form">
<table cellpadding="0" cellspacing="0" class="formtable">
	<caption>
		<h2>{lang no_register_message_0}</h2>
		<p>{lang no_register_message_1}</p>
	</caption>
	<tr>
		<td>
		<a href="home.php?mod=misc&ac=$_G['setting'][register_action]" style="display: block; margin: 0 110px 2em; width: 100px; border: 1px solid #486B26; background: #76A14F; line-height: 30px; font-size: 14px; text-align: center; text-decoration: none;"><strong style="display: block; border-top: 1px solid #9EBC84; color: #FFF; padding: 0 0.5em;">{lang register_now}</strong></a>
		</td>
	</tr>
</table>
</div>
<!--{template common/footer}-->